﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ECommerce.Common
{
    public sealed class SiteSession
    {
        public static System.Web.SessionState.HttpSessionState Session
        {
            get
            {
                if (System.Web.HttpContext.Current == null)
                {
                    return null;
                }
                else
                {
                    return System.Web.HttpContext.Current.Session;
                }
            }
        }

        public static int MemberID
        {
            get
            {
                return (int)Session["MemberID"];
            }
            set
            {
                Session["MemberID"] = value;
            }
        }
       
        public static string MemberLoginName
        {
            get
            {
                if (Session == null)
                {
                    return null;
                }
                else
                {
                    return (string)Session["MemberLoginName"];
                }
            }
            set
            {
                Session["MemberLoginName"] = value;
            }
        }
        

        public static void Clear()
        {
            Session.Clear();
        }

    }
}
